package com.cherry.amqp.service;

import com.cherry.amqp.bean.Book;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class BookService {

    @RabbitListener(queues = "cherry.news")
    public void receive(Book book){
        System.out.println("收到消息："+book);
    }

//    @RabbitListener(queues = "cherry")
//    public void receive02(Message message){
//        System.out.println(message.getBody());
//        System.out.println(message.getMessageProperties());
//    }
}
